﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace VisualBounds.Imaging.PaintBucket.UI
{
    public class vManager
    {
        IntPtr Handle;
        int left, top, right, bottom;

        public vManager(IntPtr Handle, int left, int top, int right, int bottom)
        {
            this.Handle = Handle;
            this.left = left;
            this.top = top;
            this.right = right;
            this.bottom = bottom;
            Extend();
        }

        public void Extend()
        {
            if (Windows.DwmIsCompositionEnabled())
            {
                Windows.MARGINS margins = new Windows.MARGINS(left, top, right, bottom);
                Windows.DwmExtendFrameIntoClientArea(Handle, margins);
            }
        }

        public Color DrawColor()
        {
            if (Windows.DwmIsCompositionEnabled())
                return Color.Black;
            else if (Windows.GetThemeName().EndsWith("Aero.msstyle"))
                if (Windows.GetForegroundWindow() != Handle)
                    return Color.FromArgb(185, 209, 234);
                else
                    return Color.FromArgb(215, 228, 242);
            else
                return SystemColors.Control;
        }

    }
}
